home *** CD-ROM | disk | FTP | other *** search
/ Windows Expert / Windows Expert.iso / utility / appshl.zip / APPGLOBL.BAS < prev    next >
BASIC Source File  |  1991-08-17  |  16KB  |  416 lines

  1. ' ================
  2. ' Copyrights & CYA
  3. ' ================
  4. '
  5. ' App Shell is freeware with the following intent:
  6. '
  7. ' -  You are free to incorporate App Shell into your code that will be
  8. '    distributed in executable form.
  9. ' -  You are free to distribute App Shell source or incorporate App Shell
  10. '    source into your source code assuming no charge is required and this
  11. '    copyright is maintained and acknowledged.
  12. ' -  You are free to distribute App Shell source as shareware assuming
  13. '    you are an approved vendor and associate member of the Association
  14. '    of Shareware Professionals (ASP).  No registration fee is required
  15. '    but this copyright must be maintained and acknowledged.
  16. ' -  All other distribution rights are maintained by the author.
  17. ' -  The author makes NO warranties, express or implied, oral or written,
  18. '    including any implied warranties of merchantability or fitness for
  19. '    a particular purpose.  In no event shall the author be liable for
  20. '    any damages whatsoever arising out of the use of the software.
  21. '
  22. ' If you find any bugs, anomalies, or have any questions or suggestions,
  23. ' please send them to Jim Presley (CIS ID - 73417,2674).  Enjoy!
  24. '
  25. '
  26. '============================================================================'
  27. '                                                                            '
  28. ' Visual Basic global constant file.  This file can be loaded into the       '
  29. ' global module.                                                             '
  30. '                                                                            '
  31. ' Some constants are commented out because they have duplicates (for         '
  32. ' example, NONE appears in several places).                                  '
  33. '                                                                            '
  34. '============================================================================'
  35. DefInt A-Z
  36. '========='
  37. '         '
  38. ' General '
  39. '         '
  40. '========='
  41.  
  42. ' Booleans
  43. Global Const true = -1
  44. Global Const false = 0
  45. Global Const FILE_NOT_FOUND = 53
  46. Global Const PATH_NOT_FOUND = 76
  47.  
  48.  
  49. '=================='
  50. '                  '
  51. ' Event parameters '
  52. '                  '
  53. '=================='
  54.  
  55. ' Button and Shift (KeyDown, KeyUp, MouseDown, MouseMove, MouseUp)
  56. Global Const SHIFT_MASK = 1
  57. Global Const CTRL_MASK = 2
  58. Global Const ALT_MASK = 4
  59. Global Const LEFT_BUTTON = 1
  60. Global Const RIGHT_BUTTON = 2
  61. Global Const MIDDLE_BUTTON = 4
  62.  
  63. ' ErrNum (LinkError)
  64. Global Const WRONG_FORMAT = 1
  65. Global Const REQUEST_WITHOUT_INIT = 2
  66. Global Const DDE_WITHOUT_INIT = 3
  67. Global Const ADVISE_WITHOUT_INIT = 4
  68. Global Const POKE_WITHOUT_INIT = 5
  69. Global Const DDE_SERVER_CLOSED = 6
  70. Global Const TOO_MANY_LINKS = 7
  71. Global Const STRING_TOO_LONG = 8
  72. Global Const INVALID_CONTROL_ARRAY_REFERENCE = 9
  73. Global Const UNEXPECTED_DDE = 10
  74. Global Const OUT_OF_MEMORY = 11
  75. Global Const SERVER_ATTEMPTED_CLIENT_OPERATION = 12
  76.  
  77. ' KeyCode (KeyDown, KeyUp)
  78. Global Const KEY_LBUTTON = &H1
  79. Global Const KEY_RBUTTON = &H2
  80. Global Const KEY_CANCEL = &H3
  81. Global Const KEY_MBUTTON = &H4         ' NOT contiguous with L & RBUTTON
  82. Global Const KEY_BACK = &H8
  83. Global Const KEY_TAB = &H9
  84. Global Const KEY_CLEAR = &HC
  85. Global Const KEY_RETURN = &HD
  86. Global Const KEY_SHIFT = &H10
  87. Global Const KEY_CONTROL = &H11
  88. Global Const KEY_MENU = &H12
  89. Global Const KEY_PAUSE = &H13
  90. Global Const KEY_CAPITAL = &H14
  91. Global Const KEY_ESCAPE = &H1B
  92. Global Const KEY_SPACE = &H20
  93. Global Const KEY_PRIOR = &H21
  94. Global Const KEY_NEXT = &H22
  95. Global Const KEY_END = &H23
  96. Global Const KEY_HOME = &H24
  97. Global Const KEY_LEFT = &H25
  98. Global Const KEY_UP = &H26
  99. Global Const KEY_RIGHT = &H27
  100. Global Const KEY_DOWN = &H28
  101. Global Const KEY_SELECT = &H29
  102. Global Const KEY_PRINT = &H2A
  103. Global Const KEY_EXECUTE = &H2B
  104. Global Const KEY_SNAPSHOT = &H2C
  105. Global Const KEY_INSERT = &H2D
  106. Global Const KEY_DELETE = &H2E
  107. Global Const KEY_HELP = &H2F
  108.  
  109. ' KEY_A thru KEY_Z are the same as their ASCII equivalents: 'A' thru 'Z'
  110. ' KEY_0 thru KEY_9 are the same as their ASCII equivalents: '0' thru '9'
  111.  
  112. Global Const KEY_NUMPAD0 = &H60
  113. Global Const KEY_NUMPAD1 = &H61
  114. Global Const KEY_NUMPAD2 = &H62
  115. Global Const KEY_NUMPAD3 = &H63
  116. Global Const KEY_NUMPAD4 = &H64
  117. Global Const KEY_NUMPAD5 = &H65
  118. Global Const KEY_NUMPAD6 = &H66
  119. Global Const KEY_NUMPAD7 = &H67
  120. Global Const KEY_NUMPAD8 = &H68
  121. Global Const KEY_NUMPAD9 = &H69
  122. Global Const KEY_MULTIPLY = &H6A
  123. Global Const KEY_ADD = &H6B
  124. Global Const KEY_SEPARATOR = &H6C
  125. Global Const KEY_SUBTRACT = &H6D
  126. Global Const KEY_DECIMAL = &H6E
  127. Global Const KEY_DIVIDE = &H6F
  128. Global Const KEY_F1 = &H70
  129. Global Const KEY_F2 = &H71
  130. Global Const KEY_F3 = &H72
  131. Global Const KEY_F4 = &H73
  132. Global Const KEY_F5 = &H74
  133. Global Const KEY_F6 = &H75
  134. Global Const KEY_F7 = &H76
  135. Global Const KEY_F8 = &H77
  136. Global Const KEY_F9 = &H78
  137. Global Const KEY_F10 = &H79
  138. Global Const KEY_F11 = &H7A
  139. Global Const KEY_F12 = &H7B
  140. Global Const KEY_F13 = &H7C
  141. Global Const KEY_F14 = &H7D
  142. Global Const KEY_F15 = &H7E
  143. Global Const KEY_F16 = &H7F
  144. Global Const KEY_NUMLOCK = &H90
  145.  
  146. ' State (DragOver)
  147. Global Const ENTER = 0
  148. Global Const LEAVE = 1
  149. Global Const OVER = 2
  150.  
  151. '====================='
  152. '                     '
  153. ' Function parameters '
  154. '                     '
  155. '====================='
  156.  
  157. ' MsgBox parameters
  158. Global Const MB_OK = 0                 ' OK button only
  159. Global Const MB_OKCANCEL = 1           ' OK and Cancel buttons
  160. Global Const MB_ABORTRETRYIGNORE = 2   ' Abort, Retry, and Ignore buttons
  161. Global Const MB_YESNOCANCEL = 3        ' Yes, No, and Cancel buttons
  162. Global Const MB_YESNO = 4              ' Yes and No buttons
  163. Global Const MB_RETRYCANCEL = 5        ' Retry and Cancel buttons
  164.  
  165. Global Const MB_ICONSTOP = 16          ' Critical message
  166. Global Const MB_ICONQUESTION = 32      ' Warning query
  167. Global Const MB_ICONEXCLAMATION = 48   ' Warning message
  168. Global Const MB_ICONINFORMATION = 64   ' Information message
  169.  
  170. Global Const MB_DEFBUTTON1 = 0         ' First button is default
  171. Global Const MB_DEFBUTTON2 = 256       ' Second button is default
  172. Global Const MB_DEFBUTTON3 = 512       ' Third button is default
  173.  
  174. ' MsgBox return values
  175. Global Const IDOK = 1                  ' OK button pressed
  176. Global Const IDCANCEL = 2              ' Cancel button pressed
  177. Global Const IDABORT = 3               ' Abort button pressed
  178. Global Const IDRETRY = 4               ' Retry button pressed
  179. Global Const IDIGNORE = 5              ' Ignore button pressed
  180. Global Const IDYES = 6                 ' Yes button pressed
  181. Global Const IDNO = 7                  ' No button pressed
  182.  
  183.  
  184. '==================='
  185. '                   '
  186. ' Method parameters '
  187. '                   '
  188. '==================='
  189.  
  190. ' Drag (controls)
  191. Global Const CANCEL = 0
  192. Global Const BEGIN_DRAG = 1
  193. Global Const END_DRAG = 2
  194.  
  195. ' GetData, GetFormat, SetData (Clipboard)
  196. Global Const CF_LINK = &HBF00
  197. Global Const CF_TEXT = 1
  198. Global Const CF_BITMAP = 2
  199. Global Const CF_METAFILE = 3
  200. Global Const CF_DIB = 8
  201.  
  202. ' Show (form)
  203. Global Const Modal = 1
  204. Global Const MODELESS = 0
  205.  
  206. '================='
  207. '                 '
  208. ' Property values '
  209. '                 '
  210. '================='
  211.  
  212. ' Alignment (label)
  213. Global Const LEFT_JUSTIFY = 0          ' 0 - Left Justify
  214. Global Const RIGHT_JUSTIFY = 1         ' 1 - Right Justify
  215. Global Const CENTER = 2                ' 2 - Center
  216.  
  217. ' BackColor, ForeColor, FillColor (standard RGB colors: form, controls)
  218. Global Const BLACK = &H0&
  219. Global Const RED = &HFF&
  220. Global Const GREEN = &HFF00&
  221. Global Const YELLOW = &HFFFF&
  222. Global Const BLUE = &HFF0000
  223. Global Const MAGENTA = &HFF00FF
  224. Global Const CYAN = &HFFFF00
  225. Global Const WHITE = &HFFFFFF
  226.  
  227. ' BackColor, ForeColor, FillColor (system colors: form, controls)
  228. Global Const SCROLL_BARS = &H80000000           ' Scroll-bars gray area.
  229. Global Const DESKTOP = &H80000001               ' Desktop.
  230. Global Const ACTIVE_TITLE_BAR = &H80000002      ' Active window caption.
  231. Global Const INACTIVE_TITLE_BAR = &H80000003    ' Inactive window caption.
  232. Global Const MENU_BAR = &H80000004              ' Menu background.
  233. Global Const WINDOW_BACKGROUND = &H80000005     ' Window background.
  234. Global Const WINDOW_FRAME = &H80000006          ' Window frame.
  235. Global Const MENU_TEXT = &H80000007             ' Text in menus.
  236. Global Const WINDOW_TEXT = &H80000008           ' Text in windows.
  237. Global Const TITLE_BAR_TEXT = &H80000009        ' Text in caption, size box, scroll-bar arrow box..
  238. Global Const ACTIVE_BORDER = &H8000000A         ' Active window border.
  239. Global Const INACTIVE_BORDER = &H8000000B       ' Inactive window border.
  240. Global Const APPLICATION_WORKSPACE = &H8000000C ' Background color of multiple document interface (MDI) applications.
  241. Global Const HIGHLIGHT = &H8000000D             ' Items selected item in a control.
  242. Global Const HIGHLIGHT_TEXT = &H8000000E        ' Text of item selected in a control.
  243. Global Const BUTTON_FACE = &H8000000F           ' Face shading on command buttons.
  244. Global Const BUTTON_SHADOW = &H80000010         ' Edge shading on command buttons.
  245. Global Const GRAY_TEXT = &H80000011             ' Grayed (disabled) text.  This color is set to 0 if the current display driver does not support a solid gray color.
  246. Global Const BUTTON_TEXT = &H80000012           ' Text on push buttons.
  247.  
  248. ' BorderStyle (form, label, picture box, text box)
  249. Global Const NONE = 0              ' 0 - None
  250. Global Const FIXED_SINGLE = 1          ' 1 - Fixed Single
  251. Global Const SIZABLE = 2           ' 2 - Sizable (Forms only)
  252. Global Const FIXED_DOUBLE = 3          ' 3 - Fixed Double (Forms only)
  253.  
  254. ' DragMode (controls)
  255. Global Const MANUAL = 0                ' 0 - Manual
  256. Global Const AUTOMATIC = 1             ' 1 - Automatic
  257.  
  258. ' DrawMode (form, picture box, Printer)
  259. Global Const BLACKNESS = 1             ' 1 - Blackness
  260. Global Const NOT_MERGE_PEN = 2         ' 2 - Not Merge Pen
  261. Global Const MASK_NOT_PEN = 3          ' 3 - Mask Not Pen
  262. Global Const NOT_COPY_PEN = 4          ' 4 - Not Copy Pen
  263. Global Const MASK_PEN_NOT = 5          ' 5 - Mask Pen Not
  264. Global Const INVERT = 6                ' 6 - Invert
  265. Global Const XOR_PEN = 7               ' 7 - Xor Pen
  266. Global Const NOT_MASK_PEN = 8          ' 8 - Not Mask Pen
  267. Global Const MASK_PEN = 9              ' 9 - Mask Pen
  268. Global Const NOT_XOR_PEN = 10          ' 10 - Not Xor Pen
  269. Global Const NOP = 11                  ' 11 - Nop
  270. Global Const MERGE_NOT_PEN = 12        ' 12 - Merge Not Pen
  271. Global Const COPY_PEN = 13             ' 13 - Copy Pen
  272. Global Const MERGE_PEN_NOT = 14        ' 14 - Merge Pen Not
  273. Global Const MERGE_PEN = 15            ' 15 - Merge Pen
  274. Global Const WHITENESS = 16            ' 16 - Whiteness
  275.  
  276. ' DrawStyle (form, picture box, Printer)
  277. Global Const SOLID = 0                 ' 0 - Solid
  278. Global Const DASH = 1                  ' 1 - Dash
  279. Global Const DOT = 2                   ' 2 - Dot
  280. Global Const DASH_DOT = 3              ' 3 - Dash-Dot
  281. Global Const DASH_DOT_DOT = 4          ' 4 - Dash-Dot-Dot
  282. Global Const INVISIBLE = 5             ' 5 - Invisible
  283. Global Const INSIDE_SOLID = 6          ' 6 - Inside Solid
  284.  
  285. ' FillStyle (form, picture box, Printer)
  286. ' Global Const SOLID = 0               ' 0 - Solid
  287. Global Const TRANSPARENT = 1           ' 1 - Transparent
  288. Global Const HORIZONTAL_LINE = 2       ' 2 - Horizontal Line
  289. Global Const VERTICAL_LINE = 3         ' 3 - Vertical Line
  290. Global Const UPWARD_DIAGONAL = 4       ' 4 - Upward Diagonal
  291. Global Const DOWNWARD_DIAGONAL = 5     ' 5 - Downward Diagonal
  292. Global Const CROSS = 6                 ' 6 - Cross
  293. Global Const DIAGONAL_CROSS = 7        ' 7 - Diagonal Cross
  294.  
  295. ' LinkMode (controls)
  296. ' Global Const NONE = 0                ' 0 - None
  297. Global Const HOT = 1                   ' 1 - Hot
  298. Global Const COLD = 2                  ' 2 - Cold
  299.  
  300. ' LinkMode (form)
  301. ' Global Const NONE = 0                ' 0 - None
  302. Global Const SERVER = 1                ' 1 - Server
  303.  
  304. ' MousePointer (form, controls)
  305. Global Const DEFAULT = 0           ' 0 - Default
  306. Global Const ARROW = 1             ' 1 - Arrow
  307. Global Const CROSSHAIR = 2         ' 2 - Cross
  308. Global Const IBEAM = 3             ' 3 - I-Beam
  309. Global Const ICON_POINTER = 4      ' 4 - Icon
  310. Global Const SIZE_POINTER = 5      ' 5 - Size
  311. Global Const SIZE_NE_SW = 6        ' 6 - Size NE SW
  312. Global Const SIZE_N_S = 7          ' 7 - Size N S
  313. Global Const SIZE_NW_SE = 8        ' 8 - Size NW SE
  314. Global Const SIZE_W_E = 9          ' 9 - Size W E
  315. Global Const UP_ARROW = 10         ' 10 - Up Arrow
  316. Global Const HOURGLASS = 11        ' 11 - Hourglass
  317. Global Const NO_DROP = 12          ' 12 - No drop
  318.  
  319. ' ScaleMode (form, picture box, Printer)
  320. Global Const USER = 0                  ' 0 - User
  321. Global Const TWIPS = 1                 ' 1 - Twip
  322. Global Const POINTS = 2                ' 2 - Point
  323. Global Const PIXELS = 3                ' 3 - Pixel
  324. Global Const CHARACTERS = 4            ' 4 - Character
  325. Global Const INCHES = 5                ' 5 - Inch
  326. Global Const MILLIMETERS = 6           ' 6 - Millimeter
  327. Global Const CENTIMETERS = 7           ' 7 - Centimeter
  328.  
  329. ' ScrollBar (text box)
  330. ' Global Const NONE = 0                ' 0 - None
  331. Global Const HORIZONTAL = 1            ' 1 - Horizontal
  332. Global Const VERTICAL = 2              ' 2 - Vertical
  333. Global Const BOTH = 3                  ' 3 - Both
  334.  
  335. ' Value (check box)
  336. Global Const UNCHECKED = 0             ' 0 - Unchecked
  337. Global Const CHECKED = 1               ' 1 - Checked
  338. Global Const GRAYED = 2                ' 2 - Grayed
  339.  
  340. ' WindowState (form)
  341. Global Const NORMAL = 0                ' 0 - Normal
  342. Global Const MINIMIZED = 1             ' 1 - Minimized
  343. Global Const MAXIMIZED = 2             ' 2 - Maximized
  344.  
  345. '
  346. ' Windows API Constant Declarations
  347. '
  348. Global Const MF_BYPOSITION = &H400
  349. Global Const WM_USER = &H400
  350. Global Const LB_DIR = WM_USER + 14
  351. Global Const LB_RESETCONTENT = WM_USER + 5
  352. Global Const EM_LIMITTEXT = WM_USER + 21
  353. Global Const WM_WININICHANGE = &H1A
  354. Global Const WF_STANDARD = &H10
  355. Global Const WF_ENHANCED = &H20
  356.  
  357. ' WinHelp command constants
  358.     
  359. Global Const HELP_CONTEXT = 1
  360. Global Const HELP_QUIT = 2
  361. Global Const HELP_INDEX = 3
  362. Global Const HELP_HELPONHELP = 4
  363.     
  364.  
  365.  
  366. '
  367. ' Windows API Function Declarations
  368. '
  369.  
  370. Declare Function GetSystemMenu Lib "User" (ByVal hWnd, ByVal bRevert)
  371. Declare Function RemoveMenu Lib "User" (ByVal hMenu, ByVal nPosition, ByVal wFlags)
  372. Declare Function GetFocus Lib "User" () As Integer
  373. Declare Function SendMessage Lib "User" (ByVal a%, ByVal b%, ByVal c%, ByVal d As Any) As Long
  374. Declare Function GetProfileString Lib "Kernel" (ByVal App$, Keyname As Any, ByVal DefaultVal$, ByVal RetBuf$, ByVal Size%) As Integer
  375. Declare Function WriteProfileString Lib "Kernel" (ByVal App$, ByVal Key$, ByVal Setting$) As Integer
  376. Declare Function WinHelp Lib "User" (ByVal hWnd As Integer, ByVal lpHelpFile As String, ByVal wCommand As Integer, dwData As Any) As Integer
  377. Declare Function SetActiveWindow Lib "User" (ByVal hdc)
  378. Declare Function GetFreeSpace Lib "Kernel" (ByVal wFlags) As Long
  379. Declare Function GetWinFlags Lib "Kernel" () As Long
  380. Declare Function AppShellPrSetup Lib "AppShell" (ByVal hWnd%, ByVal Printer$, ByVal Driver$, ByVal Port$) As Integer
  381. Declare Function LoadLibrary Lib "Kernel" (ByVal lpLibFileName As String) As Integer
  382. Declare Sub FreeLibrary Lib "Kernel" (ByVal hLibModule As Integer)
  383.  
  384. '
  385. ' Miscellaneous
  386. '
  387. Global CRLF                    As String * 2
  388.  
  389. '
  390. ' Global Program Variables
  391. '
  392. Global Const APP_NAME = "App Shell"
  393. Global Const PGM_NAME = "APPSHELL"
  394. Global App_Changed         As Integer
  395. Global App_OpenTitle       As String
  396. Global App_SaveTitle       As String
  397. Global App_OpenSaveStyle   As Integer
  398. Global Const APP_OPEN = 0
  399. Global Const APP_SAVE = 1
  400. Global App_PrSetupTitle    As String
  401. Global App_PrinterName     As String
  402. Global App_PrinterDriver   As String
  403. Global App_PrinterPort     As String
  404. Global App_PrintCopyNumber As Integer
  405. Global App_PrintCopies     As Integer
  406. Global App_PrintCancel     As Integer
  407. Global App_FullFileName    As String
  408. Global App_FileName        As String
  409. Global App_Path            As String
  410. Global App_Drive           As String
  411. Global App_FileExtension   As String
  412. Global App_DialogReturn    As Integer
  413.  
  414. Global App_Data            As String
  415.  
  416.